package com.zzzzzz.topic.model;

import org.springframework.data.neo4j.annotation.GraphId;
import org.springframework.data.neo4j.annotation.GraphTraversal;
import org.springframework.data.neo4j.annotation.Indexed;
import org.springframework.data.neo4j.annotation.NodeEntity;

import com.zzzzzz.account.model.UserGraph;

@NodeEntity
public class TopicGraph {
	
	@GraphId Long id;

	@Indexed
	private String topicId;

	public TopicGraph() {
		
	}

	public TopicGraph(String topicId) {
		this.topicId = topicId;
	}
    
    @GraphTraversal(traversal = LikeIncomingTraversalBuilder.class, elementClass = UserGraph.class)
    private Iterable<UserGraph> allUsersWhoLike;

	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	public String getTopicId() {
		return topicId;
	}

	public void setTopicId(String topicId) {
		this.topicId = topicId;
	}

	public Iterable<UserGraph> getAllUsersWhoLike() {
		return allUsersWhoLike;
	}

	public void setAllUsersWhoLike(Iterable<UserGraph> allUsersWhoLike) {
		this.allUsersWhoLike = allUsersWhoLike;
	}

}
